<template>
	<view class="an-body pB100ux">		
		
		<view class="comsterlist">	
			<nodata v-if="visiterlist.length==0"></nodata> 
			<view class="topics borderb1" v-for="(item,index) in visiterlist">
				<view class="an-top-bg bg_white p5 pL10 pR10" >
					<!-- 用户信息 -->				 
					<!-- <view class="company">{{item.company_name}}</view> -->
					<view class="an-userInfo">						
						<view class="an-user-text1">
							<view style="color: black;">
								<view class="an-user-first">
									<p>发生时间：{{item.createtime_new}}</p>
									<p class="pT5"  v-if="item.frequency_type_p =='减少积分'"> 发生原因：{{item.event_p}}<span style="color:red;">（{{item.frequency_type_p}}）</span></p>
									<p class="pT5"  v-if="item.frequency_type_p =='增加积分'"> 发生原因：{{item.event_p}}<span style="color:green;">（{{item.frequency_type_p}}）</span></p>
									<p class="pT5" v-if="choosetype=='u1'"> 被分享人：{{item.my_name}}</p>
									<p class="pT5" v-if="item.frequency_type_p =='减少积分'" > 发生积分：<span style="color:red;font-weight: bold;">-{{item.frequency}}</span></p>
									<p class="pT5" v-if="item.frequency_type_p =='增加积分'" > 发生积分：<span style="color:green;font-weight: bold;">+{{item.frequency}}</span></p></p>
									<p class="pT5"> 积分余额：<span style="font-weight: bold;">{{item.surplus}}</span></p>
								</view>
								<!--<view class="an-user-second">
									
									 <p>到访部门：{{item.dept_name?item.dept_name:'暂无'}}</p> 
									<p class='topics-operation pT5'>
										<view class="topics-details" :class="delchanger?'':'mlA'" @click="visitor(item)">详情</view>
									</p>
								</view>-->
							</view>
						</view>
					</view>
			
				</view>	
			</view>		
		</view>
		<!-- 底部导航 -->
		<footernav pagePath='user'></footernav>
		
		<!-- 加载动画 -->
		<loading v-if="!isloading()"></loading>
	</view>
</template>
<script>
import {integratelist} from "@/common/api/user.js"
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import {timestampToTime} from "@/common/common.js"
export default {	
	data() {
		return {
			showtab:"1",
			userSrc: '',
			grids: [],
			visiterlist:[],
			audlist:[],
			page:1,
			pageSize:10,
			choosetype:'',
			delchanger:false,
		};
	},
	onLoad(event) {
		if(event.type){
			this.choosetype=event.type;
		}
		this.getvisiterList()
	
		
	},
	onShow() {
		
	},
	methods: {
		backRefresh(type){ //返回刷新带参数
			this.visiterlist=[];
			this.audlist=[];
			this.page=1;
			this.getvisiterList();
		},
		
		retime(val){
			return timestampToTime(val)
		},
		
		/*获取访客列表*/
		getvisiterList(){
			integratelist({
				'page':this.page,
				type:this.choosetype,
				'pagesize':this.pageSize
			}).then(res=>{
				// var last=JSON.stringify(res); //将JSON对象转化为JSON字符
				// alert(last);
				if(res.data.code == 400){
					return
				}
				// this.visiterlist = res.data.data
			this.page++
			for (let i = 0; i < res.data.data.length; i++) {
				this.visiterlist.push(res.data.data[i])
			}
			})
		},
		
		

		
	}
};
</script>

<style lang="scss" scoped>
	.tablist .on{border-bottom: 2px solid #ed6c19;}
.an-user {
	.an-quick {
		display: flex;
		flex-direction: row;

		padding: 15px 15px;
		.an-ico-item {
			// width: 25%;
			text-align: center;
			.an-ico-img {
				text-align: center;
				width: 40px;
				height: 40px;
				line-height: 40px;
				margin: 0 auto;
				border-radius: 50%;
				color: #ffffff;
				.iconfont {
					font-size: 21px;
				}
				&.color1 {
					//background-color: #e9f4fd;
					background: linear-gradient(#bb51fb, #883ffe);
				}
				&.color2 {
					background: linear-gradient(#f9ac8e, #ec5e5c);
				}
				&.color3 {
					background: linear-gradient(#78f5b1, #34ce78);
				}
				&.color4 {
					background: linear-gradient(#68aefb, #007aff);
				}
			}
		}
	}
	.an-list {
		.an-ico {
			margin-right: 10px;
			.iconfont {
				font-size: 21px;
			}
			&.color1 {
				color: #ec5e5c;
			}
			&.color2 {
				color: #883ffe;
			}
			&.color3 {
				color: #34ce78;
			}
			&.color4 {
				color: #007aff;
			}
		}
	}
}
.uni-list-cell-divider{
	    background-color: white;
}
.an-top-bg{
	height: auto;
	 // padding: 0px 0px 0px 0px;
	position: static !important;
}
uni-button{
	width: 80px;
	height: 30px;
	font-size: 15px;
	line-height: 30px;
}
.cc{
	background: #007aff;
	color: white;
	margin-right: 10px;
	float: right;
}
.cc2{
	background: #ED6C19;
	color: white;
	margin-right: 10px;
	float: right;
}
.an-userInfo{
	background: white;
	// margin-top: 10px;
}
.an-user{
	margin-top: 5px;
	width: 13%;
}
.an-user image{
	border-radius:50% ;
}
.an-user-text{
	margin-top: 5px;
}
.cc-view{
	text-align: right;
	margin-top: 5px;
}
.an-user-text1{
	width: 80%;
	margin-bottom: 10px;
	margin-left:2%;
}
.company{
	color: black;
	margin-left: 10px;
}
.an-user-first{
	float: left;
	width: 100%;
	// margin-top: 10px;
}
.an-user-second{
	float: left;
	width: 49%;
	// margin-top: 10px;
	text-align: right;
}
	.topics-operation {
		
		justify-content: flex-end;
		// width: 65%;
		margin-left: auto;
		display: flex;
		uni-view {
			width: 60px;
			height: 24px;
			margin: 0 5px;
			color: rgba(255, 255, 255, 1);
			background-color: rgba(212, 48, 48, 1);
			border-radius: 18px;
			font-size: 15px;
			line-height: 24px;
			text-align: center;
		}
		.topics-modify {
			color: rgba(80, 80, 80, 1);
			background-color: rgba(166, 166, 166, 1);
		}
		.topics-details {
			background-color: rgba(42, 130, 228, 1);
		}
	}
	
</style>
